/* 
 * jobs/index.js
 */
count = 0;
appletCount = 0;

$(document).ready(function(){
 
  
//  // Show and hide Elfinder div based on click
//  $("#elfinder_form input").click( function() {
//    $('#file_exp').toggle(400, function(){
//      if(++count % 2) {
//        $("#elfinder_form input").val("Hide File Explorer");
//      }
//      else {
//        $("#elfinder_form input").val("Show File Explorer");
//      }
//    });
//  });
//  
//  // Initialie Elfinder
//  $('#file_exp').elfinder({
//        url : '/imagerecon/webroot/js/libs/Elfinder1.2/connectors/php/connector.php',
//        //url : '../libs/Elfinder1.2/connectors/php/connector.php', // doesn't work
//        // For UTK server:
//        //url : '/~jfrank3/imagerecon/webroot/js/libs/Elfinder1.2/connectors/php/connector.php',
//        lang : 'en',
//        docked: true
//        //modal:  true
//  }).hide(); 
  
    
  
    // remove ImageJ applet
//  $('#hideAppletBtn').click(function(event){
//    //alert("JQuery noticed you clicked inside the applet_div!");
//    //$('#applet').hide(fast, null);
//    $('#applet_div').hide();
//    //$('#applet').remove(null);
//  });
  
  $('#hideAppletBtn').click(function() {
    $('#applet_div').toggle(400, function(event){
      //$('#hideAppletBtn').val("Show Fiji");
      $('#hideAppletBtn').text("Show Fiji");
    
    });
  });
  
//  $('#hideAppletBtn').click(function() {
//    
//  });
  
  
  
//  
//  
  // TEMP: hide Elfinder and ImageJ to remove clutter
  hideElfinderAndImageJ();
  // TEMP: show Elfinder and ImageJ upon clicking btn
  $("#showElfinderAndImageJBtn").click(showElfinderAndImageJ);
  
}); // end document ready func


// temp code to remove clutter while developing
function hideElfinderAndImageJ() {
  $("#applet_div").hide();
  $("#hideAppletBtn").hide();
  $("#imageJH4").hide();
  //$("#elfinder_form").hide();
  //$("#file_exp").hide() 
}
// temp code to show clutter while developing
function showElfinderAndImageJ() {
  $("#applet_div").show(1000);
  $("#hideAppletBtn").show();
  $("#imageJH4").show();
  //$("#elfinder_form").show();
  //$("#file_exp").show() 
}
